package cn.liontalk.receiver;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;


/**
 * @author: 周哲
 * @package: cn.liontalk.receiver
 * @description:
 * @date: 2019/1/10 19:50
 * @version: V1.0
 */
@Component
@RabbitListener(
        bindings = @QueueBinding(
                value = @Queue(value = "${mq.config.queue.logs}",autoDelete = "true"),
                exchange = @Exchange(value = "${mq.config.exchange}",type = ExchangeTypes.TOPIC),
                key = "*.log.*"
        )

)
public class LogsReceiver {
    @RabbitHandler
    public void receiveMessage(String message){
        System.out.println("....All...Message:"+ message);
    }

}
